package actions;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;

import beans.Module;
import beans.User;

import com.opensymphony.xwork2.ActionSupport;

import controllers.AbstractController;


public class UserModule extends ActionSupport {

	private static final long serialVersionUID = 1164809814839976523L;

	private static final Logger LOGGER = Logger.getLogger(UserModule.class);

	
	// -------------------------------------------------------------
	// Objects
	// -------------------------------------------------------------

	AbstractController controller = new AbstractController();

	private int idUser;
	private List<Module> result;
	
	
	// -------------------------------------------------------------
	// Methods
	// -------------------------------------------------------------

	public String execute() {
		setResult(controller.getModuleByUserId(getIdUser()));
		System.out.println(getResult().size());
		return SUCCESS;
	}


	public List<Module> getResult() {
		return result;
	}


	public void setResult(List<Module> result) {
		this.result = result;
	}


	public int getIdUser() {
		return idUser;
	}


	public void setIdUser(int idUser) {
		this.idUser = idUser;
	}



}
